<%@ page import="com.swt.draw.entity.Admin" %>
<%@ page import="org.apache.shiro.SecurityUtils" %>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>主页</title>
    <link rel="stylesheet" href="/gzht/statics/css/common.css"/>
    <link rel="stylesheet" href="/gzht/statics/css/iconfont.css"/>
    <link rel="stylesheet" href="/gzht/statics/css/style.css"/>
</head>
<body>
<% Admin admin = (Admin) SecurityUtils.getSubject().getPrincipal();
    if (admin.getAdminStatus() == 1) {
        // 禁用账号
%>
<div style="width: 500px;height: 300px;margin: 200px auto;text-align: center;">
    <div>
        <h1>此账号已被禁用，请联系管理员!</h1>
    </div>
    <div style="margin-top: 1rem;">
        <a href="logout">返回登录</a>
    </div>
</div>
<%
} else {
%>
<div class="headerpage"></div>
<iframe name="pageFrame" onload="changeFrameHeight(this)" src="/gzht/drawTool" runat="server" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes"></iframe>
<%
    }
%>
<script type="text/javascript" src="/gzht/statics/js/jquery-1.12.2.min.js"></script>
<script>
    function changeFrameHeight(that){
        $(that).height(document.documentElement.clientHeight - 120);
    }
    $(function () {
        /*公共部分
         * 导航栏
         */
        $(".headerpage").load("/gzht/statics/common/header.html");
    });
</script>
</body>
</html>
